<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="css/animate.min.css">
  <style type="text/css">
    .demo-enter,
    .demo-leave-to {
      opacity: 0;
    }

    .demo-enter-active,
    .demo-leave-active {
      transition: opacity 3s;
    }
  </style>
</head>

<body>
  <div id="app">
    <!-- mode 属性 指定元素的进入顺序  先出后进-->
    <transition-group name='demo'>
      <div v-for='item in list' :key='item.id'>{{item.title}}</div>
    </transition-group>
    <button @click="handleCLick">add</button>

  </div>

  <script type="text/javascript" src="js/vue.js"></script>
  <script>
    var count = 1
    var vm = new Vue({
      el: '#app',
      data: {
        list: [{
          id: 0,
          title: 'hhhh'
        }]
      },
      methods: {
        handleCLick() {
          // this.show = !this.show
          this.list.push({
            id: count++,
            title: 'hello world'
          })
        },

      }
    })
  </script>
</body>

</html>